package com.pattern.structural.adaptor;

import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/**
 * @Description  define a Aspect class, which could include many specific aspect inside.
 * @Author Ping
 * @Date 2022/3/27 23:16
 **/
@Component
@Aspect
public class LogAspect1 {
    /**
     * For an aspect, point-cut need to be specified at first.
     * And then, the advice should be defined sequentially.
     */
    @Pointcut(value="execution(* com.pattern.structural.adaptor.TestAop1.*(..))")
    public void loggingPointCut() {

    }

    /**
     * advice defined here.
     */
    @Before(value="loggingPointCut()")
    public void loggingAdvisor() {
        /**
         * the advice, ie., the logic to be weaved.
         */
        System.out.println("Before invoke method .") ;
    }
}
